import java.net.InetAddress;
import java.net.Socket;

/**
 * @author Nicholas Gilbert
 * Class that lets the server know what peers are connected
 * there ip addresses, if they are a super peer, and what 
 * there current throughput from the peer to the server
 */
public class Peer {
	public InetAddress ipAddress; //peers IP address
	public boolean superPeer; //flag for if this peer is a super peer
	public int throughput; //the throughput between the server and the peer
	public Socket myConnection; //socket used by the peer for connection
	public int numConnections; //the number of active connections to this superPeer
	
	public Peer()
	{
		myConnection = null;
		numConnections=0;
	}
	
	public String toPrintString()
	{
		return "IP:"+ipAddress.toString()+"\tSuper Peer:"+superPeer+"\tThroughput:"+throughput;
	}
	public String toString()
	{
		return "class:Peer;"+ipAddress.toString()+";"+superPeer+";"+throughput+";"+numConnections;
	}
}
